---
title: "Ring Color"
description: "Utilities for setting the color of outline rings."
---

import plugin from 'tailwindcss/lib/plugins/ringColor'
import { Variants } from '@/components/Variants'
import { Disabling } from '@/components/Disabling'

export const classes = {
  plugin,
  transformProperties: ({ selector, properties }) => {
    delete properties['--tw-ring-opacity']
    return properties
  }
}


## Usage

Use the `ring-{color}` utilities to set the color of an [outline ring](/docs/ring-width).

```html indigo
<template preview class="flex justify-center p-8">
  <button tabindex="-1" class="focus:outline-none w-32 py-2 rounded-md font-semibold text-white bg-indigo-500 ring-4 ring-indigo-300">
    Button
  </button>
</template>

<button class="... ring-4 **ring-indigo-300**">
  Button
</button>
```

### Changing opacity

You can control the opacity of rings using the `ring-opacity-{amount}` utilities:

```html amber
<template preview class="flex justify-center p-8">
  <button tabindex="-1" class="focus:outline-none w-32 py-2 rounded-md font-semibold text-white bg-amber-500 ring-4 ring-amber-500 ring-opacity-50">
    Button
  </button>
</template>

<button class="... ring-4 **ring-yellow-500** **ring-opacity-50**">
  Button
</button>
```

For more information, see the [ringOpacity documentation](/docs/ring-opacity).

---

## Responsive

To control the ring color at a specific breakpoint, add a `{screen}:` prefix to any existing ring color utility. For example, use `md:ring-blue-500` to apply the `ring-blue-500` utility at only medium screen sizes and above.

```html
<button class="ring-2 ring-blue-300 **md:ring-blue-500**">
  <!-- ... -->
</button>
```

For more information about Tailwind's responsive design features, check out the [Responsive Design](/docs/responsive-design) documentation.

---

## Customizing

You can customize which ring color utilities are generated by customizing your color palette using the `colors` key in the `theme` section of your `tailwind.config.js` file:

```js
// tailwind.config.js
const colors = require('tailwindcss/colors')

module.exports = {
  theme: {
    colors: {
      gray: colors.blueGray,
      indigo: colors.indigo,
      red: colors.rose,
      yellow: colors.yellow,
    }
  }
}
```

If you'd like to customize only the ring color utilities without affecting your global color palette, use the `ringColor` key instead:

```js
// tailwind.config.js
const colors = require('tailwindcss/colors')

module.exports = {
  theme: {
    ringColor: {
      white: colors.white,
      pink: colors.fuchsia,
    }
  }
}
```

Learn more about customizing the default theme in the [theme customization documentation](/docs/theme#customizing-the-default-theme).

### Variants

<Variants plugin="ringColor" />

### Disabling

<Disabling plugin="ringColor" />
